<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>购物车</title>
<style>
#list{width:300px;}
#list li{list-style: none;border:1px solid #BBB;padding:10px 5px;margin-top:5px;}
#list{font-size:13px;}
#list li h3{border-bottom:2px dotted #ccc;}
#list li p{color:blue;}
</style>
</head>
<body>
<?php echo form_open('path/to/controller/update/function'); ?>

<table cellpadding="6" cellspacing="1" style="width:100%" border="0">

<tr>
  <th>QTY</th>
  <th>Item Description</th>
  <th style="text-align:right">Item Price</th>
  <th style="text-align:right">Sub-Total</th>
</tr>

<?php $i = 1; ?>

<?php foreach ($this->cart->contents() as $items): ?>

 <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?>
 
 <tr>
   <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td>
   <td>
  <?php echo $items['name']; ?>
     
   <?php if ($this->cart->has_options($items['rowid']) == TRUE): ?>
     
    <p>
     <?php foreach ($this->cart->product_options($items['rowid']) as $option_name => $option_value): ?>
      
      <strong><?php echo $option_name; ?>:</strong> <?php echo $option_value; ?><br />
          
     <?php endforeach; ?>
    </p>
    
   <?php endif; ?>
    
   </td>
   <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td>
   <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td>
 </tr>

<?php $i++; ?>

<?php endforeach; ?>

<tr>
  <td colspan="2"> </td>
  <td class="right"><strong>Total</strong></td>
  <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td>
</tr>

</table>

<p><?php echo form_submit('', 'Update your Cart'); ?></p>
</body>
</html>